<include file="Public/header"/>

<div id="app">
    <!-- sidebar -->
    <include file="Public/left"/>
    <!-- / sidebar -->
    <div class="app-content">
        <!-- start: TOP NAVBAR -->
        <include file="Public/headernav"/>
        <!-- end: TOP NAVBAR -->
        <div class="main-content">
            <div class="wrap-content container" id="container">
                <!-- start: PAGE TITLE -->
                <section id="page-title">
                    <div class="row">
                        <div class="col-sm-8 col-md-offset-5">
                            <h1 class="mainTitle">{$msgtitle}</h1>
                            <span class="mainDescription">&nbsp;&nbsp;添加分类</span>
                        </div>

                    </div>
                </section>
                <!-- end: PAGE TITLE -->
                <!-- start: YOUR CONTENT HERE -->
                <div class="container-fluid container-fullw bg-white">
                    <form action="" role="form" id="form2" novalidate="novalidate" method="post">
                        <div class="container-fluid container-fullw bg-white">
                            <div class="row">
                                <div class="col-md-8 col-md-offset-2">
                                    <div class="form-group">
                                        <label class="control-label">
                                            商品类型名称 <span class="symbol required" aria-required="true"></span>
                                        </label>
                                        <input type="text" placeholder="填写商品类型名称" class="form-control" id="cat_name"
                                               name="cat_name" value="{$type.cat_name}"/>
                                    </div>
                                    <!-- 状态 -->
                                    <div class="form-group">
                                        <label class="control-label">
                                            是否可用
                                        </label>

                                        <div class="clip-radio radio-primary fa-hover Primary">
                                            <input type="radio" value="1" name="enabled" id="i_enabled_yes" checked>
                                            <label for="i_enabled_yes">
                                                可用
                                            </label>

                                            <input type="radio" value="0" name="enabled" id="i_enabled_no">
                                            <label for="i_enabled_no">
                                                不可用
                                            </label>

                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label">
                                            属性分组
                                        </label>
                                    <textarea class="form-control autosize" id="attr_group" name="attr_group"
                                              data-autosize-on="true"
                                              style="overflow: hidden; resize: horizontal; word-wrap: break-word; height: 71px;"
                                              value="{$type.attr_group}">{$type.attr_group}</textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-4 col-md-offset-5">
                                    <button class="btn btn-primary btn-wide pull-left" type="submit" id="submit">
                                        提交 <i class="fa fa-arrow-circle-right"></i>
                                    </button>
                                </div>

                                <div class="col-md-8">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>


                <!-- end: YOUR CONTENT HERE -->
            </div>
        </div>
    </div>
    <!--  FOOTER and SETTINGS -->

    <include file="Public/footer"/>
    <!-- end: FOOTER -->
    <!-- start: OFF-SIDEBAR -->

    <!-- end: OFF-SIDEBAR -->

</div>
<!-- start: MAIN JAVASCRIPTS -->

<include file="Public/javascript"/>

<!-- end: CLIP-TWO JAVASCRIPTS -->

<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY -->
<script src="__PUBLIC__/bootstrap/vendor/ckeditor/adapters/jquery.js"></script>
<script src="__PUBLIC__/bootstrap/vendor/jquery-validation/jquery.validate.min.js"></script>
<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY -->
<!-- start: CLIP-TWO JAVASCRIPTS -->
<!-- <script src="__PUBLIC__/bootstrap/assets/js/main.js"></script> -->
<!-- start: JavaScript Event Handlers for this page -->
<!--<script src="__PUBLIC__/bootstrap/assets/js/form-validation.js"></script>-->
<script type="text/javascript">
    // $().function.ready(function() {
    // jQuery.validator.addMethod("byteRangeLength", function(value) {
    // 	var dropdown=$("#dropdown").val();
    // 	var ret=true;
    //     if(dropdown>0){
    //        if(!value){
    //         ret=false;
    //        }
    //     }
    //   return ret;
    // });

    // $("#dropdown").change(function(){
    // 	var val=$(this).val();
    // 	if(val>0){
    // 		$(".menu_icons").hide();
    // 	}else{
    // 		$(".menu_icons").show();
    // 	}

    // });

    $("#form2").validate({
        rules: {
            cat_name: "required",
            grade: "digits",
            sort_order: {
                digits: true,
                max: 50
            }
        },
        messages: {
            cat_name: "请输入分类名称",
            grade: "必须输入整数",
            sort_order: {
                digits: "必须输入整数且不大于50",
                max: "必须输入整数且不大于50"
            }
        }
    });
    // })
</script>
<!-- end: JavaScript Event Handlers for this page -->
</body>
</html>
